#pragma once

#include "funpl.h"
#include "ast.h"
#include <vector>

namespace funpl
{

namespace ast
{

/// Meta definition.
struct metadef : public node
{
protected:
	/// Constructor.
	metadef(node_type::t nodeType, node *parent = nullptr)
		: node(nodeType, parent) { }
};

struct type;

/// Meta type node.
struct metatype : public metadef
{
	util::const_char_range name;

	type *restrictions;

	/// Constructor.
	metatype(node *parent = nullptr,
		const util::const_char_range &name = util::empty_const_char_range())
			: metadef(node_type::metatype, parent),
			name(name),
			restrictions() { }
};

struct type;
struct expression;

/// Meta variable node.
struct metavariable : public metadef
{
	util::const_char_range name;

	type *type;

	expression *defaultValue;

	/// Constructor.
	metavariable(node *parent = nullptr,
		const util::const_char_range &name = util::empty_const_char_range())
			: metadef(node_type::metavariable, parent),
			name(name),
			type(),
			defaultValue() { }
};

} // namespace

} // namespace